check file cs_bin with path {{ consul_link_path }}/bin/consul
  group consul

check file cs_config with path {{ consul_link_path }}/consul.d/main.json
  group consul

check process consul with pidfile {{ consul_main_config.pid_file }}
  start program = "{{ consul_link_path }}/bin/consul agent --config-dir={{ consul_link_path }}/consul.d" with timeout 60 seconds
  stop program = "{{ consul_link_path }}/bin/consul leave" with timeout 60 seconds
  if failed
    host {{ consul_main_config.addresses.http }}
    port {{ consul_main_config.ports.http }}
    protocol http
    with timeout 60 seconds
    then alert
  depends on cs_bin,cs_config
  group consul
